<?php
defined('IN_PHPCMS') or exit('No permission resources.');
pc_base::load_sys_class('model', '', 0);

/**
 * 订单模型数据库操作类
 */
class order_model extends model
{
	

    public function __construct()
    {
        $this->db_config = pc_base::load_config('database');
        $this->db_setting = 'default';
        $this->table_name = 'order';
        $this->admin_db = pc_base::load_model('admin_model');
        $this->admin_userid = param::get_cookie('userid'); // 获取当前登录的管理员ID
        $this->siteid = get_siteid();//获取当前站点
        parent::__construct();
    }
    /**
     * 编辑订单
     * param 订单信息
     * status 订单状态
     * id 更新的数据ID
     * @date: 2017-09-02 09:17:27
     * @author: 吴发顶
     */
    public function order_edit($param,$talent_type=1,$id) {
    	$info = isset($param) ? $param : showmessage(L('illegal_parameters'),HTTP_REFERER);
    	$data['real_name'] = $info['real_name'];
    	$data['en_name'] = $info['en_name'];
    	$data['nickname'] = $info['nickname'];
    	$data['gender'] = $info['gender'];
    	$data['age'] = $info['age'];
    	$data['birthday'] = $info['birthday'];
    	$data['height'] = $info['height'];
    	$data['weight'] = $info['weight'];
    	$data['university'] = $info['university'];
    	$data['diploma'] = $info['diploma'];
    	$data['province'] = $info['province'];
    	$data['city'] = $info['city'];
    	$data['bust'] = $info['bust'];
    	$data['waist'] = $info['waist'];
    	$data['hips'] = $info['hips'];
    	$data['shoe_size'] = $info['shoe_size'];
    	$data['telephone'] = $info['telephone'];
    	$data['email'] = $info['email'];
    	$data['identification'] = $info['identification'];
    	$data['address'] = $info['address'];
    	$data['award'] = $info['award'];
    	$data['hobby'] = $info['hobby'];
    	$data['introduction'] = $info['introduction'];
    	$data['follow'] = rand(500,1000);
    	$data['praise'] = rand(500,1000);
    	$data['image_horizontal'] = $info['image_horizontal'];//横向图
		$data['image_vertical'] = $info['image_vertical'];//纵向图
		$data['image_square'] = $info['image_square'];//方形图
		$data['image_circular'] = $info['image_circular'];//圆形图
    	$data['update_time'] = date("Y-m-d H:i:s");
    	$data['created_by'] = $data['updated_by'] = $data['updated_by'] =  $_SESSION['userid'];
    	$data['siteid'] = get_siteid();
    	$data['source'] = $info['source'];
    	$data['status'] = '1';
    	$data['people'] = $info['people'];//人种
    	$data['label'] = $info['label'];//模特类别
    	$data['letter'] = trim($info['letter']);//模特姓名首字母
    	$data['new_city'] = $info['new_city'];
    	$result = model::update($data,array('id'=>$id));
    	return $result;
    }
}